package routers

import (
	"xmshop-gin/controllers/front"

	"github.com/gin-gonic/gin"
)

func FrontRoutersInit(r *gin.Engine) {
	frontRoutes := r.Group("/")
	{
		frontRoutes.GET("/", front.IndexController{}.Index)
		frontRoutes.GET("/category:id", front.ProductController{}.Category)
		frontRoutes.GET("/detail", front.ProductController{}.Detail)
		frontRoutes.GET("/product/getImgList", front.ProductController{}.GetImgList)

		frontRoutes.GET("/cart", front.CartController{}.Get)
		frontRoutes.GET("/cart/addCart", front.CartController{}.AddCart)

		frontRoutes.GET("/cart/successTip", front.CartController{}.AddCartSuccess)

		frontRoutes.GET("/cart/decCart", front.CartController{}.DecCart)
		frontRoutes.GET("/cart/incCart", front.CartController{}.IncCart)

		frontRoutes.GET("/cart/changeOneCart", front.CartController{}.ChangeOneCart)
		frontRoutes.GET("/cart/changeAllCart", front.CartController{}.ChangeAllCart)
		frontRoutes.GET("/cart/delCart", front.CartController{}.DelCart)

		frontRoutes.GET("/pass/login", front.PassController{}.Login)
		frontRoutes.GET("/pass/captcha", front.PassController{}.Captcha)

		frontRoutes.GET("/pass/registerStep1", front.PassController{}.RegisterStep1)
		frontRoutes.GET("/pass/registerStep2", front.PassController{}.RegisterStep2)
		frontRoutes.GET("/pass/registerStep3", front.PassController{}.RegisterStep3)
		frontRoutes.GET("/pass/sendCode", front.PassController{}.SendCode)
	}
}
